# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=mycroft-gui
pkgver=1.0
pkgrel=1
pkgdesc="The Graphical User Interface used by the Mycroft Mark II and more"
url="https://mycroft.ai"
# ppc64le, s390x, armhf, mips and mips64 blocked by qt5-qtwebview
arch="all !ppc64le !s390x !armhf !mips !mips64"
license="Apache-2.0"
depends="kirigami2 mycroft-skill-mark2"
makedepends="extra-cmake-modules qt5-qtbase-dev qt5-qtdeclarative-dev qt5-qtmultimedia-dev
	qt5-qtwebsockets-dev qt5-qtwebview-dev plasma-framework-dev kdbusaddons-dev kio-dev"
source="https://github.com/MycroftAI/mycroft-gui/archive/v$pkgver/mycroft-gui-v$pkgver.tar.gz
	https://github.com/MycroftAI/mycroft-gui/commit/d97e1af35c8bba46acd271933aef5eb2b6158d0c.patch
	"
options="!check" # Tests fail to compile

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_TESTING=OFF \
		-DBUILD_REMOTE_TTS=ON
	# TODO: enable tests
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="2a28b4cbfcc4c0a7af297b5bfbc76be5dd35947addc94292bf04388ac196e23eb0a1b50bdb7cc4a21c32d52db3694336cd3b8bae3ce74883172a49c6e932666d  mycroft-gui-v1.0.tar.gz
2a277551eff149f7a674857b13b68e52666c06505709980e6e507fb3a8fe79571377cb9e1570d303d8bc52346f030640a4cd96710b46de59f8eb3b6a11d0a12d  d97e1af35c8bba46acd271933aef5eb2b6158d0c.patch"
